{extend name="./static/page/admin_tpl.html" /}

{block name="header_title"}大话软件后台{/block}
{block name="page_css"}
<link href="{$__TEMPLETE__}/css/admin/petAticle/addAticle.css" rel="stylesheet">
<link href="{$__PUBLIC__}/umeditor/themes/default/css/umeditor.min.css" type="text/css" rel="stylesheet">
{/block}
{block name="page_header_js"}
<script type="text/javascript" charset="utf-8" src="{$__PUBLIC__}/umeditor/third-party/template.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{$__PUBLIC__}/umeditor/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="{$__PUBLIC__}/umeditor/umeditor.min.js"></script>
<script type="text/javascript" src="{$__PUBLIC__}/umeditor/lang/zh-cn/zh-cn.js"></script>
{/block}
{block name="content"}
<div class="col-md-12 right-section">
    <!--内容区域-->
    <h3>修改文章</h3>
    <div class="inner-section row">
        <div class="items add-div">
            <form action="#" method="post" id="myForm"  enctype="multipart/form-data">
                <table class="table table-striped table-hover table-bordered table-base">
                    <tr>
                        <td class="td1"><label>分类</label></td>
                        <td class="td2">
                            <select id="label_id" class="label_id" name="label_id">
                                {foreach $labels as $label}
                                <option value="{$label.id}" {if $label.id == $aticleInfo.label_id } selected {/if} > {$label.name} </option>
                                {/foreach}
                            </select>
                        </td>
                        <td class="td3"></td>
                    </tr>
                    <tr>
                        <td class="td1"><label for="title"><span class="must-tag">*</span>文章标题</label></td>
                        <td class="td2"><input type="text" id="title" name="title" placeholder="文章标题" value="{$aticleInfo.title}"></td>
                        <td class="td3"></td>
                    </tr>
                    <tr>
                        <td class="td1"><label for="aticle_desc"><span class="must-tag">*</span>文章简介</label></td>
                        <td class="td2"><input type="text" id="aticle_desc" name="aticle_desc" placeholder="文章简介" value="{$aticleInfo.aticle_desc}"></td>
                        <td class="td3"></td>
                    </tr>
                    <tr>
                        <td class="td1"><label for="author"><span class="must-tag">*</span>作者</label></td>
                        <td class="td2"><input type="text" id="author" name="author" placeholder="作者姓名" value="{$aticleInfo.author}"></td>
                        <td class="td3"></td>
                    </tr>
                    <tr>
                        <td><label for="imgurl"><span class="must-tag">&nbsp;&nbsp;</span>图片更新</label></td>
                        <td>
                            <input type="hidden" name="prevurl" value="{$__LOD__.$aticleInfo.thumb}">
                            <!---是否重新上传图片标识 0未更新，1更新图片-->
                            <input type="hidden" id="imgFlag" name="imgFlag" value="0">
                            <input class="imgurl form-control"  accept="image/*" title="支持jpg、jpeg、gif、png格式，文件小于5M" tabindex="3" type="file" id="imgurl" name="imgurl" size="3">
                            <img src="{$__LOD__.$aticleInfo.thumb}" style="height: 40px;"  title="缩略图" >&nbsp;&nbsp;
                            图片建议尺寸：100px*100px
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td class="td1"><label for="path"><span class="must-tag">*</span>文章链接</label></td>
                        <td class="td2"><input type="text" id="path" name="path" placeholder="文章链接" value="{$aticleInfo.path}"></td>
                        <td class="td3"></td>
                    </tr>
                    <tr>
                        <td class="td1">
                            <label for="content"><span class="must-tag">*</span>文章详情</label>
                        </td>
                        <td class="td2">
                            <div id="content" name="content"  style="width:780px;height:200px;">
                                {:nl2br($aticleInfo.content)}
                            </div>



                            <script type="text/javascript">
                            //实例化编辑器
                            var um = UM.getEditor('content');
                            </script>

                        </td>
                        <td class="td3"></td>
                    </tr>
                    <tr>
                        <td>
                            <input type="hidden" name="aid" id="aid" class="aid" value="{$aticleInfo.id}">
                        </td>
                        <td><button type="button" class="btn btn-success btn-md" id='save'>修改</button></td>
                        <td></td>
                    </tr>
                </table>

            </form>
        </div>
    </div>
</div>
{/block}
{block name="page_js"}
<script src="{$__TEMPLETE__}/js/admin/petAticle/aticleDetail.js"></script>
{/block}